<?php
 
class CronStatusModel extends Model{

    public function getCateList($curr_page,$per_page,$filter = array()){
        $where = ' 1=1 ';
        $bindarr = array();

        if(isset($filter['cate_name'])){
            $where .= ' and cate_name like :cate_name';
            $bindarr['cate_name'] = '%'.$filter['cate_name'].'%';
        }

        if(isset($filter['action'])){
            $where .= ' and action like :action';
            $bindarr['action'] = '%'.$filter['action'].'%';
        }

        $ret = $this->pager($curr_page, $per_page)
                ->ct('select count(*) from ugc_log where ' . $where , $bindarr)
                ->rs('select * from ugc_log where '.$where,$bindarr);
        return $ret;
    }

}